<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="follow, index" />
<meta name="author" content="iune co." />
<meta name="description"
	content="IUNE有最好的库存管理SaaS软件。以更快更高的准确度，跟进实时数据的访问和库存移动。" />
<meta name="keywords"
	content="库存, 存货管理, 库存管理, 仓库管理, 云ERP, 云逸ERP, 中小型企业云ERP, SaaS ERP软件/系统" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>

<style type="text/css">
td {
	padding: 0px;
	width: 100px;
}
</style>

</head>
<body>



	<div class="container-fluid"
		data-ng-controller="periodCaptionInitialCtrl as Model">

		<div class="row">
			<div class="col-sm-12">
				<nav class="nav">
					<form class="navbar-form navbar-left buttonBar" name="periodCaptionInitial_form">
				        <div class="form-group has-warning has-feedback">
				        	<label>开账年月</label>
				        	<input type="text" class="form-control" 
								ng-minlength=7 
		            			ng-maxlength=7 
		            			ng-pattern="pattKjkzny"
		            			placeholder="yyyy-MM" 
		            			ng-model="kjkzny" 
					        	ng-disabled="Model.dataMaster.getCount()>0"
				        		name="kjkzny" required>
					        	<span class="glyphicon glyphicon-remove form-control-feedback" ng-show="periodCaptionInitial_form.kjkzny.$invalid" aria-hidden="true"></span>
					        	<span class="glyphicon glyphicon-ok form-control-feedback" ng-show="periodCaptionInitial_form.kjkzny.$valid" aria-hidden="true"></span>
				        </div>
						<div class="btn-group" role="toolbar" ng-hide="dataConfigure.kjkzok==1">
				        	<button type="button" class="btn btn-default" ng-click="Model.initial()" ng-disabled="Model.dataMaster.getCount()>0 || periodCaptionInitial_form.kjkzny.$invalid"><span class="glyphicon glyphicon-flag"></span> 开账</button>
							
							<button type="button" class="btn btn-default"
								data-ng-disabled="Model.dataMaster.getCount()<=0"
								data-ng-show="Model.dataMaster.readonly()"
								data-ng-click="Model.clear()" title="之后，可以重新开账。">
								<span class="glyphicon glyphicon-remove"></span> 清除开账数据
							</button>
	
							<button type="button" class="btn btn-default"
								data-ng-disabled="Model.dataMaster.currentIndex==null"
								data-ng-show="Model.dataMaster.readonly()"
								data-ng-click="Model.edit();">
								<span class="glyphicon glyphicon-edit"></span> 修改
							</button>

							<button type="button" class="btn btn-success "
								data-ng-show="!Model.dataMaster.readonly()"
								data-ng-click="Model.save();">
								<span class="glyphicon glyphicon-floppy-save"></span> 保存
							</button>
							<button type="button" class="btn btn-warning "
								data-ng-show="!Model.dataMaster.readonly()"
								data-ng-click="Model.saveCancel();">
								<span class="glyphicon glyphicon-floppy-open"></span> 取消
							</button>
						</div>
			      	</form>

				</nav>
			</div>
		</div>

		<div class="row">
			<div class="col-sm-12">

			<div class="table-responsive">
				<table class="table table-condensed table-bordered" style="margin:0px;" data-readonly={{Model.dataMaster.readonly()}}>
					<thead>
						<tr style="background-color:lightgrey;">
							<th style="text-align: center;">#</th>
							<th>科目编码</th>
							<th>科目名称</th>
							<th>方向</th>
							<th>年初余额</th>
							<th>本年累计借方</th>
							<th>本年累计贷方</th>
							<th>期初余额</th>
							<th>币种</th>
						</tr>
					</thead>
					<tbody>
						<tr data-ng-show="row.userdata.recordState!='delete'" ng-style="rowStyle(row)"
							data-readonly={{row.nodeKind.value==null}}
							data-ng-class="{true:'active'}[Model.dataMaster.currentIndex==Model.dataMaster.rows.indexOf(row)]"
							data-ng-click="Model.dataMaster.onRowClick(row,$event)"
							data-ng-repeat="row in Model.dataMaster.rows">
							
							<td style="width: 20px;text-align: center;">
								<span data-ng-show="Model.dataMaster.currentIndex==Model.dataMaster.rows.indexOf(row)" class="glyphicon glyphicon-hand-right" aria-hidden="true"></span>
								<span data-ng-show="Model.dataMaster.currentIndex!=Model.dataMaster.rows.indexOf(row)">{{Model.dataMaster.rows.indexOf(row)+1}}</span>
							</td>

							<td style="width: 100px;"><span data-ng-bind="row.captionNo.value"></span></td>
							<td style="width: 300px;" ng-style="nameStyle(row)" title="">
								<span data-ng-bind="row.captionName.value" uib-tooltip="{{row.itemDescribe.value}}" tooltip-trigger="mouseenter"></span>
							</td>
							<td style="width: 50px;text-align: left;">
								<span data-ng-if="row.dob.value==1">借方</span>
								<span data-ng-if="row.dob.value==-1">贷方</span>
								<span data-ng-if="row.dob.value==0">无</span>
							</td>
							
							<td style="width: 100px;text-align: right;" td-input="number" 
								readonly="false" data-ng-model="row.balanceYearBegin.value">
								<span data-ng-bind="row.balanceYearBegin.value | number:2"></span>
							</td>
							<td style="width: 100px;text-align: right;" td-input="number" 
								readonly="false" data-ng-model="row.debitYear.value">
								<span data-ng-bind="row.debitYear.value | number:2"></span>
							</td>
							<td style="width: 100px;text-align: right;" td-input="number" 
								readonly="false" data-ng-model="row.creditYear.value">
								<span data-ng-bind="row.creditYear.value | number:2"></span>
							</td>
							<td style="width: 100px;text-align: right;" td-input="number" 
								readonly="false" data-ng-model="row.balanceBegin.value">
								<span data-ng-bind="row.balanceBegin.value | number:2"></span>
							</td>
							
							<td style="width: 50px;text-align: left;">
								<span data-ng-bind="row.currencyLabel.value"></span>
							</td>

						</tr>
					</tbody>

					<tfoot>
					</tfoot>

				</table>
			</div>

			</div>

		</div>


		<div class="row">
			<div class="col-sm-12">
				<nav class="nav">
      				<ul class="pagination navbar-right buttonBar">
						<li>
							<div class="btn-group" role="toolbar" data-ng-show="Model.dataMaster.readonly()">
								<button type="button" class="btn btn-default" data-ng-click="Model.initTrialPop()">
									<span class="glyphicon glyphicon-refresh"></span> 试算平衡
								</button>
								<button type="button" class="btn btn-default" data-ng-click="Model.initSubmit()" ng-disabled="dataConfigure.kjkzok==1">
									<span class="glyphicon glyphicon-refresh"></span> 结束开账
								</button>
								<button type="button" class="btn btn-default" data-ng-click="Model.initActive()" ng-disabled="dataConfigure.kjkzok==0">
									<span class="glyphicon glyphicon-refresh"></span> 取消结束
								</button>
							</div>
						</li>
					</ul>
				</nav>
				
				<br>
				
			</div>
		</div>


	</div>





</body>

</html>

